home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr46 / prexcm20.zip / PROTECT.BAT < prev    next >
DOS Batch File  |  1993-05-30  |  1KB  |  44 lines

  1. echo off
  2. rem ONLY USE THIS FOR FILES THAT HAVE NOT ALREADY BEEN PKLITED OR LZEXED!!!
  3. cls
  4. if exist %1.%2 goto filefound
  5. echo To use PROTECT.BAT, the first parameter is the name part of the filename
  6. echo  and the second part is the extension:
  7. echo  
  8. echo Here is an example to protect MYPROG.EXE:
  9. echo   PROTECT MYPROG EXE
  10. echo Here is an example to protect MYPROG.COM:
  11. echo   PROTECT MYPROG COM
  12. echo  
  13. echo (Basically, just leave out the period and use a space between the
  14. echo  filename and the extension.)
  15. echo  
  16. echo Please only use this on files that have not already been compressed!!!
  17. goto end
  18. :filefound
  19. if %2==COM goto comfile
  20. if %2==com goto comfile
  21. if %2==Com goto comfile
  22. if %2==COm goto comfile
  23. if %2==cOM goto comfile
  24. if %2==cOm goto comfile
  25. if %2==coM goto comfile
  26. del %1.old >NUL
  27. del %1.tmp >NUL
  28. rem YOU CAN USE PKLITE BELOW, BUT USE THE -B (BACKUP) OPTION AND CHANGE
  29. REM THE SUFFIXES FROM .OLD TO .BAK!!!!!!!!!!!!!!
  30. lzexe %1.EXE 
  31. if exist %1.old goto exenormal
  32. echo %1.EXE could not be compressed by LZEXE...
  33. goto end    
  34. :exenormal
  35. ren %1.old %1.tmp
  36. protexcm %1.EXE Put the desired password here!!!
  37. del %1.old >NUL
  38. ren %1.tmp %1.old
  39. echo %1.EXE has been protected, %1.OLD is the original!
  40. goto end
  41. :comfile
  42. rem SEE THE COMMENT ABOVE ABOUT PKLITE, BUT ON COM FILES!!!!!!!
  43. protexcm %1.COM Put the desired password here!!!
  44. :end